'''
Company: TWL
Author: xue jian
Email: xuejian@kanzhun.com
Date: 2020-11-02 20:52:50
'''
#
# @lc app=leetcode.cn id=349 lang=python3
#
# [349] 两个数组的交集
#

# @lc code=start
from typing import List
class Solution:
    def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
        nums2 = set(nums2)
        ans = set()
        for i in nums1:
            if i in nums2:
                ans.add(i)
        return list(ans)
        
# @lc code=end

